//
// CFrustum.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;

public class CFrustum {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CFrustum(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CFrustum obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CFrustum(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setLeft(float value) {
    nel3dJNI.CFrustum_Left_set(swigCPtr, this, value);
  }

  public float getLeft() {
    return nel3dJNI.CFrustum_Left_get(swigCPtr, this);
  }

  public void setRight(float value) {
    nel3dJNI.CFrustum_Right_set(swigCPtr, this, value);
  }

  public float getRight() {
    return nel3dJNI.CFrustum_Right_get(swigCPtr, this);
  }

  public void setBottom(float value) {
    nel3dJNI.CFrustum_Bottom_set(swigCPtr, this, value);
  }

  public float getBottom() {
    return nel3dJNI.CFrustum_Bottom_get(swigCPtr, this);
  }

  public void setTop(float value) {
    nel3dJNI.CFrustum_Top_set(swigCPtr, this, value);
  }

  public float getTop() {
    return nel3dJNI.CFrustum_Top_get(swigCPtr, this);
  }

  public void setNear(float value) {
    nel3dJNI.CFrustum_Near_set(swigCPtr, this, value);
  }

  public float getNear() {
    return nel3dJNI.CFrustum_Near_get(swigCPtr, this);
  }

  public void setFar(float value) {
    nel3dJNI.CFrustum_Far_set(swigCPtr, this, value);
  }

  public float getFar() {
    return nel3dJNI.CFrustum_Far_get(swigCPtr, this);
  }

  public void setPerspective(boolean value) {
    nel3dJNI.CFrustum_Perspective_set(swigCPtr, this, value);
  }

  public boolean getPerspective() {
    return nel3dJNI.CFrustum_Perspective_get(swigCPtr, this);
  }

  public CFrustum() {
    this(nel3dJNI.new_CFrustum__SWIG_0(), true);
  }

  public CFrustum(float left, float right, float bottom, float top, float znear, float zfar, boolean perspective) {
    this(nel3dJNI.new_CFrustum__SWIG_1(left, right, bottom, top, znear, zfar, perspective), true);
  }

  public CFrustum(float left, float right, float bottom, float top, float znear, float zfar) {
    this(nel3dJNI.new_CFrustum__SWIG_2(left, right, bottom, top, znear, zfar), true);
  }

  public void init(float left, float right, float bottom, float top, float znear, float zfar, boolean perspective) {
    nel3dJNI.CFrustum_init__SWIG_0(swigCPtr, this, left, right, bottom, top, znear, zfar, perspective);
  }

  public void init(float left, float right, float bottom, float top, float znear, float zfar) {
    nel3dJNI.CFrustum_init__SWIG_1(swigCPtr, this, left, right, bottom, top, znear, zfar);
  }

  public void init(float width, float height, float znear, float zfar, boolean perspective) {
    nel3dJNI.CFrustum_init__SWIG_2(swigCPtr, this, width, height, znear, zfar, perspective);
  }

  public void init(float width, float height, float znear, float zfar) {
    nel3dJNI.CFrustum_init__SWIG_3(swigCPtr, this, width, height, znear, zfar);
  }

  public void initPerspective(float fov, float aspectRatio, float znear, float zfar) {
    nel3dJNI.CFrustum_initPerspective(swigCPtr, this, fov, aspectRatio, znear, zfar);
  }

  public void getValues(SWIGTYPE_p_float left, SWIGTYPE_p_float right, SWIGTYPE_p_float bottom, SWIGTYPE_p_float top, SWIGTYPE_p_float znear, SWIGTYPE_p_float zfar) {
    nel3dJNI.CFrustum_getValues(swigCPtr, this, SWIGTYPE_p_float.getCPtr(left), SWIGTYPE_p_float.getCPtr(right), SWIGTYPE_p_float.getCPtr(bottom), SWIGTYPE_p_float.getCPtr(top), SWIGTYPE_p_float.getCPtr(znear), SWIGTYPE_p_float.getCPtr(zfar));
  }

  public CVector project(CVector vec) {
    return new CVector(nel3dJNI.CFrustum_project(swigCPtr, this, CVector.getCPtr(vec), vec), true);
  }

  public CVector projectZ(CVector vec) {
    return new CVector(nel3dJNI.CFrustum_projectZ(swigCPtr, this, CVector.getCPtr(vec), vec), true);
  }

  public CVector unProject(CVector vec) {
    return new CVector(nel3dJNI.CFrustum_unProject(swigCPtr, this, CVector.getCPtr(vec), vec), true);
  }

  public CVector unProjectZ(CVector vec) {
    return new CVector(nel3dJNI.CFrustum_unProjectZ(swigCPtr, this, CVector.getCPtr(vec), vec), true);
  }

  public float getAspectRatio() {
    return nel3dJNI.CFrustum_getAspectRatio(swigCPtr, this);
  }

}
